package com.scanbarcode;

import com.menu.Constants;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ScanBarcodeAction extends ActionSupport{
	@Override
	public String execute() throws Exception {
		String userrole = (String) ActionContext.getContext().getSession().get("userrole");
		if (null != userrole && (userrole.equalsIgnoreCase("superadmin") || userrole.equalsIgnoreCase("admin"))) {
			
			return "success";
		}else{
			addActionError("Please login with valid userid");
			ActionContext.getContext().getSession().clear();
			return Constants.UNAUTHORISED;
		}
	}
}
